package com.gitee.luosl.cola.lang.function.checked;

import java.util.function.Consumer;

public interface CheckedConsumer<T> {

    void accept(T t) throws Throwable;

    default Consumer<T> toConsumer() {
        return t -> {
            try {
                accept(t);
            } catch (Throwable throwable) {
                throw new CheckedException(throwable);
            }
        };
    }
}
